//
//  MAKTableViewCell.h
//  MAKCommon
//
//  Created by zhuwh on 2020/3/27.
//  Copyright © 2020 mark. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "MAKTableViewCellModel.h"

NS_ASSUME_NONNULL_BEGIN

@class MAKTableView;
@class MAKTableViewCellModel;

@protocol MAKTableViewCell <NSObject>


@required
/**
 绑定数据

 @param cellModel ViewModel
 */
- (void)bindCellModel:(MAKTableViewCellModel*)cellModel inTableView:(MAKTableView *)tableView withIndexPath:(NSIndexPath *)indexPath;

@optional
+ (CGFloat)heightForCellRowTableView:(MAKTableView *)tableView indexPath:(NSIndexPath *)indexPath cellModel:(MAKTableViewCellModel*)cellModel;

@end

@protocol MAKTableViewCellHasCollectionViewDelegate <NSObject>

- (void)mak_tableViewCellHascollectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath model:(id)model actionId:(NSInteger)actionId;


@end

@interface MAKTableViewCell : UITableViewCell<MAKTableViewCell>

@property (nonatomic, strong) MAKTableViewCellModel *cellModel;
@property (nonatomic, weak) id<MAKTableViewCellHasCollectionViewDelegate> tableViewCellHasCollectionViewDelegate;

- (BOOL)isLastRowWithTableView:(UITableView*)tableView indexPath:(NSIndexPath *)indexPath;

@property (nonatomic, assign) BOOL enforceFrameLayout;

@end

NS_ASSUME_NONNULL_END
